---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  name: home-kubernetes
  namespace: flux-system
spec:
  interval: 30m
  url: "#{ bootstrap_github_address }#"
  #% if bootstrap_github_private_key %#
  secretRef:
    name: github-deploy-key
  #% endif %#
  ref:
    branch: "#{ bootstrap_github_branch|default('main', true) }#"
  ignore: |
    # exclude all
    /*
    # include kubernetes directory
    !/kubernetes
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: cluster
  namespace: flux-system
spec:
  interval: 30m
  path: ./kubernetes/flux
  prune: true
  wait: false
  sourceRef:
    kind: GitRepository
    name: home-kubernetes
  decryption:
    provider: sops
    secretRef:
      name: sops-age
  postBuild:
    substituteFrom:
      - kind: ConfigMap
        name: cluster-settings
      - kind: Secret
        name: cluster-secrets
